import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/monitor/env_history_monitor_page_entity.dart';

EnvHistoryMonitorPageEntity $EnvHistoryMonitorPageEntityFromJson(Map<String, dynamic> json) {
  final EnvHistoryMonitorPageEntity envHistoryMonitorPageEntity = EnvHistoryMonitorPageEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    envHistoryMonitorPageEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    envHistoryMonitorPageEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    envHistoryMonitorPageEntity.companyName = companyName;
  }
  final int? pointId = jsonConvert.convert<int>(json['pointId']);
  if (pointId != null) {
    envHistoryMonitorPageEntity.pointId = pointId;
  }
  final String? point = jsonConvert.convert<String>(json['point']);
  if (point != null) {
    envHistoryMonitorPageEntity.point = point;
  }
  final int? monitoringSystem = jsonConvert.convert<int>(json['monitoringSystem']);
  if (monitoringSystem != null) {
    envHistoryMonitorPageEntity.monitoringSystem = monitoringSystem;
  }
  final int? val = jsonConvert.convert<int>(json['val']);
  if (val != null) {
    envHistoryMonitorPageEntity.val = val;
  }
  final String? monitorTime = jsonConvert.convert<String>(json['monitorTime']);
  if (monitorTime != null) {
    envHistoryMonitorPageEntity.monitorTime = monitorTime;
  }
  final int? alramMinimum = jsonConvert.convert<int>(json['alramMinimum']);
  if (alramMinimum != null) {
    envHistoryMonitorPageEntity.alramMinimum = alramMinimum;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    envHistoryMonitorPageEntity.createTime = createTime;
  }
  return envHistoryMonitorPageEntity;
}

Map<String, dynamic> $EnvHistoryMonitorPageEntityToJson(EnvHistoryMonitorPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['pointId'] = entity.pointId;
  data['point'] = entity.point;
  data['monitoringSystem'] = entity.monitoringSystem;
  data['val'] = entity.val;
  data['monitorTime'] = entity.monitorTime;
  data['alramMinimum'] = entity.alramMinimum;
  data['createTime'] = entity.createTime;
  return data;
}

extension EnvHistoryMonitorPageEntityExtension on EnvHistoryMonitorPageEntity {
  EnvHistoryMonitorPageEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    int? pointId,
    String? point,
    int? monitoringSystem,
    int? val,
    String? monitorTime,
    int? alramMinimum,
    String? createTime,
  }) {
    return EnvHistoryMonitorPageEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..pointId = pointId ?? this.pointId
      ..point = point ?? this.point
      ..monitoringSystem = monitoringSystem ?? this.monitoringSystem
      ..val = val ?? this.val
      ..monitorTime = monitorTime ?? this.monitorTime
      ..alramMinimum = alramMinimum ?? this.alramMinimum
      ..createTime = createTime ?? this.createTime;
  }
}